package campeonatofutebol.persistencia;



import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DbHelper extends SQLiteOpenHelper{

	private static final int DATABASE_VERSION = 1;
	private static final String DATABASE_NOME = "dataMat.db";

	
	public static final String TABLE_TIME_NOME = "time";
	public static final String ID_TIME = "id";
	public static final String NOME_TIME = "nome";
	
	
	private static final String CREATE_TIME = "create table "
			+ TABLE_TIME_NOME + "( " + ID_TIME
			+ " integer primary key autoincrement, " + NOME_TIME
			+ " text not null)";


public DbHelper(Context context) {
	super(context, DATABASE_NOME, null, DATABASE_VERSION);
	//super()
}


@Override
public void onCreate(SQLiteDatabase db) {
	db.execSQL(CREATE_TIME);
	
}


@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
	Log.w(DbHelper.class.getName(), "Upgrading database from version " + oldVersion + " to "	+ newVersion + ", which will destroy all old data");
	db.execSQL("DROP TABLE IF EXISTS " + TABLE_TIME_NOME);
	onCreate(db);
	
}


}